package team.knowers.tourist.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import team.knowers.tourist.common.convention.result.Result;
import team.knowers.tourist.common.convention.result.Results;
import team.knowers.tourist.dao.entity.FlightDO;
import team.knowers.tourist.dto.req.PageGetFlightReqDTO;
import team.knowers.tourist.service.FlightService;

@RestController
@RequiredArgsConstructor
public class FlightController {
    private final FlightService flightService;
    @PostMapping("/api/tourist/flight/page")
    public Result<IPage<FlightDO>> pageFlight(@RequestBody PageGetFlightReqDTO req)
    {
        return Results.success(flightService.pageFlight(req));
    }
}
